package org.example.edusmart.dao;

import org.apache.ibatis.annotations.Mapper;
import org.example.edusmart.pojo.WorkAnswerPojo;
import org.example.edusmart.pojo.WorkPojo;
import org.example.edusmart.request.TeaOrStu.VerifyPojo;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface WorkDao {

    /**
     * 校验教师或学生参与教学活动的权限
     * @param verify
     * @return
     */
    Integer verifyWork(VerifyPojo verify);

    /**
     * 布置作业
     * @param work
     * @return
     */
    void assignWork(WorkPojo work);


    void  linkWork(int courseId, int workId);


    /**
     * 提交作业
     * @param answer
     * @return
     */
    int handWork(WorkAnswerPojo answer);

    /**
     * 获取课程中的作业
     * @param courseId
     * @return
     */
    List<HashMap<String, Object>> getWork(int courseId);

    /**
     * 批改作业，获取作业详情
     * @param workanswerId
     * @return
     */
    List<HashMap<String, Object>> correctWork(int workanswerId);

    /**
     * 作业给分
     * @param workanswerId
     * @param grade
     */
    void scoreWork(int workanswerId, int grade);

    /**
     * 获得作业分数
     * @param workId
     * @return
     */
    Integer getWorkGrade(int workId, int userId);

    /**
     * 检查作业的状态
     * @param workId
     * @param userId
     * @return
     */
    Integer getWorkStatus(int workId, int userId);

    List<HashMap<String, Object>> getUncorrectedWork(int workId);

    void rehandWork(WorkAnswerPojo answer);
}
